package com.example.randomthoughts.daimasuixianglu.arrayfoundation.removingelements;

/**
 * @author csd
 * @version 1.0
 */
@SuppressWarnings({"all"})
public class Solution283 {

    public static void main(String[] args) {
        int nums[]={1,0};
        moveZeroes(nums);


    }

    public static void moveZeroes(int[] nums) {
        int n = nums.length;
        if(n==1 || n==0){
            return;
        }
        int left = 0;
        for (int right = left; right < n; right++) {
            if (nums[right] != 0) {
                nums[left++] = nums[right];
            }
        }
        for (int i = left; i < n; i++) {
            nums[i]=0;
        }
        for (int i = 0; i < n; i++) {
            System.out.println(nums[i]);
        }
    }
}
